﻿using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _11文字样式
{
    public class Class1
    {
        [CommandMethod("TextStyleDemo")]
        public void TextStyleDemo()
        {
            Database db = HostApplicationServices.WorkingDatabase;
            db.AddTextStyle("我的文字样式");
            using (Transaction trans = db.TransactionManager.StartTransaction())
            {
                TextStyleTable tst = (TextStyleTable)trans.GetObject(db.TextStyleTableId, OpenMode.ForRead);
                foreach (ObjectId item in tst)
                {
                    TextStyleTableRecord tstr = (TextStyleTableRecord)item.GetObject(OpenMode.ForRead);
                }
            }
            DimStyleTableRecord
        }
    }
}
